<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        /* 
            剩余参数
                将一个不定数量的参数表示为一个数组
         */

        const sum = (...args) => {
            console.log(args); // args 是数组
        }

        sum(1, 3, 4)
        sum(1, "hello", false)

        let arry = ['a', 'b', 'c'];
        let [p, ...ps] = arry;
        console.log(p);
        console.log(ps); // [ 'b', 'c']
    </script>
</body>

</html>